package com.zgkxzx.mvvmbase.api;



import com.zgkxzx.mvvmbase.bean.picture.PictureResultBean;

import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;


/**
 * Created by Administrator on 2016/9/10.
 */
public class RestApi {
    /**
     * 获取图片
     */
    public static void getPictureList(Subscriber<PictureResultBean> subscriber, int page) {
        ApiManager.getInstance().initRetrofit().create(ApiService.class).getPictureListData()
                .subscribeOn(Schedulers.io())   //指定 subscribe() 发生在 IO 线程
                .unsubscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread()) //指定 Subscriber 的回调发生在主线程
                .subscribe(subscriber);
    }
}
